	$(function(){
        //按钮单击时执行
        $("#pay_bot_add_do").click(function(){
			toastr.options = {
			  "closeButton": true,
			  "debug": false,
			  "progressBar": true,
			  "positionClass": "toast-bottom-full-width",
			  "onclick": null,
			  "showDuration": "400",
			  "hideDuration": "1000",
			  "timeOut": "7000",
			  "extendedTimeOut": "1000",
			  "showEasing": "swing",
			  "hideEasing": "linear",
			  "showMethod": "fadeIn",
			  "hideMethod": "fadeOut"
			}
			//输入验证
           if($("#type_pay_bot_num").val() == ""){  
                toastr.warning("机器人数量不能为空！");  
                $("#type_pay_bot_num").focus();  
                return false;  
            }  
			var type_pay_bot_num = $('#type_pay_bot_num').val();
            //Ajax调用处理
            var pay_bot_add_do = $.ajax({
               type: "POST",
               url: "index.php?m=pay&c=pay_home&a=pay_bot_add_do",
               data: "type_pay_bot_num="+type_pay_bot_num,
               async: false
            }).responseText;
			if (pay_bot_add_do == "1"){
				toastr.info("余额不足购买失败！");
			} else if (pay_bot_add_do == "2") {
				toastr.success("机器人购买成功！");
			} else {
				toastr.error("请勿提交非法数据！");
			}
         });		 
    });